﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.FxCop.Sdk;
using EnvDTE;
using EnvDTE80;

namespace BovespaDesignRules
{
    public sealed class Rule_DoNotCreateEmptyInterface : BaseAddIn.Rules.BaseRuleAddIn
    {
        #region Constructor

        public Rule_DoNotCreateEmptyInterface()
            : base("BovespaDoNotCreateEmptyInterface", 
                   "BovespaDesignRules.BovespaDesignRules", 
                   typeof(Rule_DoNotCreateEmptyInterface).Assembly)
        {
        }

        #endregion

        #region Public Override Methods

        protected sealed override void Check(CodeInterface2 inter)
        {
            if (inter.Members.Count == 0)
            {
               GeraProblemaAddIn(inter.StartPoint.Parent.Parent.FullName,
                                 inter.StartPoint.Line,
                                 inter.StartPoint.DisplayColumn,
                                 "DoNotCreateEmptyInterfaceResolution",
                                 inter.Name,
                                 inter.Namespace.Name);
            }
        }

        #endregion
    }
}
